﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store Manager/SM_panel.master" AutoEventWireup="true" CodeFile="SM_ApprovGRN.aspx.cs" Inherits="Store_Manager_SM_EditPO" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2.Export, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>



<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx1" %>

<%@ Register assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">

    <script type="text/javascript">
    // <![CDATA[

    function showstock() {
            ASPxPopupControl1.Show();
        }
        </script>
    <style type="text/css">
        .style2
        {
            width: 100%;
        }
        .style4
        {
            width: 402px;
        }
        .style5
        {
            width: 142px;
            text-align: left;
        }
        .style6
    {
        width: 384px;
    }
    .style7
    {
        font-size: small;
    }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

    <table class="style2" width="100%">
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">
                <strong>
                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Select GRN No:" 
                    CssClass="style7">
                </dx:ASPxLabel>
                </strong>
            </td>
            <td>
                <strong>
               
                
                <dx:ASPxComboBox ID="DropDownList1" runat="server" ClientIDMode="AutoID"  
                        DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith"
                 DataSourceID="SqlDataSource3" 
                            onselectedindexchanged="DropDownList1_SelectedIndexChanged1" 
                    TextField="Or_ID" TextFormatString="{0}"  ValueType="System.String"
                            ValueField="Or_ID" 
                        CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
                       
                        SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" Width="200px" AutoPostBack="True" 
                        >
                        <LoadingPanelImage Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
                        </LoadingPanelImage>
                        <ButtonStyle Width="11px">
                        </ButtonStyle>
                        <ValidationSettings ErrorText="Error has occurred">
                            <ErrorFrameStyle ImageSpacing="4px">
                                <ErrorTextPaddings PaddingLeft="4px" />
                            </ErrorFrameStyle>
                        </ValidationSettings>
                    </dx:ASPxComboBox>
                </strong>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                &nbsp;</td>
            <td>
                    &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Supplier Name">
                </dx:ASPxLabel>
            </td>
            <td>
                    <dx:ASPxLabel ID="ASPxLabel16" runat="server">
                    </dx:ASPxLabel>
                </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="Supplier Bill No:">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="ASPxLabel17" runat="server">
                </dx:ASPxLabel>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel8" runat="server" Text="Book GRN No:">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="ASPxLabel14" runat="server">
                </dx:ASPxLabel>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel9" runat="server" Text="Due Date">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="ASPxLabel15" runat="server">
                </dx:ASPxLabel>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel10" runat="server" Text="Entered By">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="ASPxLabel11" runat="server">
                </dx:ASPxLabel>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
                &nbsp;</td>
            <td class="style5">             
          
                <dx:ASPxLabel ID="ASPxLabel12" runat="server" Text="GRN Entered Date">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="ASPxLabel13" runat="server">
                </dx:ASPxLabel>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style6">
          
                &nbsp;</td>
            <td class="style5">             
          
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

    <dx:ASPxGridView ID="ASPxGridView2" ClientInstanceName="ASPxGridView2" 
        runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1"  KeyFieldName="Or_ID;Pro_ID;GRN_Key"
        Width="100%" 
        oncustomunboundcolumndata="ASPxGridView2_CustomUnboundColumnData" 
        onrowupdating="ASPxGridView2_RowUpdating1" onrowdeleting="ASPxGridView2_RowDeleting" 
       >
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0" ShowSelectCheckbox="True">
            <HeaderTemplate>
                    <dx:ASPxCheckBox ID="SelectAllCheckBox" runat="server" ToolTip="Select/Unselect all rows on the page"
                        ClientSideEvents-CheckedChanged="function(s, e) {  ASPxGridView2.SelectAllRowsOnPage(s.GetChecked()); }" />
                </HeaderTemplate>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
                <HeaderStyle HorizontalAlign="Center" />
                
            </dx:GridViewCommandColumn>
                  
            <dx:GridViewDataTextColumn Caption="GRN No" FieldName="Or_ID" ReadOnly="true" 
                ShowInCustomizationForm="True" VisibleIndex="1">
                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Pro_ID" ShowInCustomizationForm="True" ReadOnly="false"
                VisibleIndex="2" Caption="Item ID">
                <EditFormSettings Visible="False" />
<EditFormSettings Visible="False"></EditFormSettings>

                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Sto_ID" ShowInCustomizationForm="True" ReadOnly="false" 
                VisibleIndex="3" Caption="Stock Code">
                <EditFormSettings Visible="False" />
<EditFormSettings Visible="False"></EditFormSettings>

                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn FieldName="Pro_Name" VisibleIndex="4" ReadOnly="True" 
                Caption="Item">
                <PropertiesComboBox TextField="Pro_Name" ValueField="Pro_Name" EnableSynchronization="False"
                    IncrementalFilteringMode="StartsWith" DataSourceID="SqlDataSource2">
                
                </PropertiesComboBox>
                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn Caption="Marked Price" FieldName="Ret_Price" 
                ReadOnly="True" VisibleIndex="5">
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Pur_Price" VisibleIndex="6" ReadOnly="true" 
                Caption="Cost" ShowInCustomizationForm="True" >
                <PropertiesTextEdit DisplayFormatString="Rs.{0}">
                </PropertiesTextEdit>
                <EditCellStyle ForeColor="Blue">
                </EditCellStyle>
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Point Value" FieldName="Point_Value" 
                ReadOnly="True" VisibleIndex="7">
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Business Value" FieldName="Business_Value" 
                ReadOnly="True" VisibleIndex="8">
                <CellStyle BackColor="#CCCCCC">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Qty" VisibleIndex="9" Caption="Quantity"   
                ShowInCustomizationForm="True">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Description" VisibleIndex="10" 
                Caption="Description" ShowInCustomizationForm="True">

            </dx:GridViewDataTextColumn>
            <dx:GridViewDataSpinEditColumn Caption="Line Total" FieldName="Total" 
                UnboundType="Decimal" VisibleIndex="11" ReadOnly="True">
                <PropertiesSpinEdit DisplayFormatString="Rs.{0}" NumberFormat="Custom">
                </PropertiesSpinEdit>
                <EditFormSettings Visible="False" />

<EditFormSettings Visible="False"></EditFormSettings>
            </dx:GridViewDataSpinEditColumn>
            <dx:GridViewDataTextColumn FieldName="GRN_Key" Visible="False" 
                VisibleIndex="12">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="True" />

<SettingsBehavior ConfirmDelete="True"></SettingsBehavior>

        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" />

<Settings ShowFilterRow="True" showfooter="True"></Settings>

        <images spritecssfilepath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <loadingpanelonstatusbar url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </loadingpanelonstatusbar>
            <loadingpanel url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </loadingpanel>
        </images>
        <imagesfiltercontrol>
            <loadingpanel url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </loadingpanel>
        </imagesfiltercontrol>
        <styles cssfilepath="~/App_Themes/BlackGlass/{0}/styles.css" 
            csspostfix="BlackGlass">
            <header imagespacing="5px" sortingimagespacing="5px">
            </header>
        </styles>
        <styleseditors>
            <calendarheader spacing="1px">
            </calendarheader>
            <progressbar height="25px">
            </progressbar>
        </styleseditors>
    </dx:ASPxGridView>
    <table class="style2" width="100%">
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style4">
                    &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style4">
                    &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style4">
                <strong>
                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Aprrove" CssClass="style7" 
                    Font-Size="Medium">
                </dx:ASPxLabel>
                </strong>
            </td>
            <td>
                <asp:DropDownList ID="DropDownList2" runat="server">
                    <asp:ListItem>YES</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
          
                <dx:ASPxButton ID="ASPxButton2" runat="server" AutoPostBack="False" 
                    ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
                    CssPostfix="BlackGlass" 
                    SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" 
                    Text="ADD Product to Existing GRN">
                    <ClientSideEvents Click="function(s, e) { showstock(); }" />
                </dx:ASPxButton>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td align="right" class="style4">
          
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style4">
                <strong>
                <dx:ASPxLabel ID="ASPxLabel4" runat="server" ForeColor="Red">
                </dx:ASPxLabel>
                <dx:ASPxLabel ID="ASPxLabel5" runat="server" ForeColor="#009933" 
                    Visible="False">
                </dx:ASPxLabel>
                </strong>
            </td>
            <td>
                <dx:ASPxButton ID="ASPxButton1" runat="server" ClientIDMode="AutoID" 
                    CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
                    SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" Text="Submit" 
                    onclick="ASPxButton1_Click">
                </dx:ASPxButton>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td class="style4">
                


<dx:ASPxPopupControl  ID="ASPxPopupControl1" runat="server" CloseAction="CloseButton" Modal="True"
        PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="ASPxPopupControl1"
        HeaderText="Add New Stock" AllowDragging="True" EnableAnimation="False" 
                     EnableViewState="False" Width="1100px" ClientIDMode="AutoID" 
                     CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
                     Height="600px" SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" 
                    ContentUrl="~/Store Manager/ItemstoGRN.aspx" CssClass="style11">
       
                    <LoadingPanelImage Url="~/App_Themes/BlackGlass/Web/Loading.gif">
                    </LoadingPanelImage>
                    <ContentStyle HorizontalAlign="Left" VerticalAlign="Top">
                    </ContentStyle>
                    <HeaderStyle>
                    <Paddings PaddingBottom="6px" PaddingLeft="15px" PaddingRight="6px" 
                        PaddingTop="3px" />
<Paddings PaddingLeft="15px" PaddingTop="3px" PaddingRight="6px" PaddingBottom="6px"></Paddings>
                    </HeaderStyle>
                    <ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
    <dx1:ASPxPanel  ID="ASPxPanel2" runat="server" Width="100%">
   
        <PanelCollection>
<dx1:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
            </dx1:PanelContent>
</PanelCollection>
   
   </dx1:ASPxPanel>
    
                        </dx:PopupControlContentControl>
</ContentCollection>
                </dx:ASPxPopupControl>











            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        SelectCommand="SELECT Tbl_GRNrequest.GRN_Key, Tbl_GRNrequest.Or_ID, Tbl_GRNrequest.Pro_Name, Tbl_GRNrequest.Pur_Price, Tbl_GRNrequest.Description, Tbl_GRNrequest.Sto_ID, Tbl_GRNrequest.Qty, Tbl_GRNrequest.Pro_ID, Tbl_GRNrequest.User_Create, Tbl_Product.Ret_Price, Tbl_Product.Point_Value, Tbl_Product.Business_Value FROM Tbl_GRNrequest INNER JOIN Tbl_Product ON Tbl_GRNrequest.Code = Tbl_Product.Code AND Tbl_GRNrequest.Pro_ID = Tbl_Product.Pro_ID WHERE (Tbl_GRNrequest.Or_ID = @Or_ID) AND (Tbl_GRNrequest.manger_status IS NULL)"
        UpdateCommand="UPDATE Tbl_GRNrequest SET [Pro_Name]=@Pro_Name, [Pur_Price]=@Pur_Price, [Description]=@Description,[Qty]=@Qty  Where [GRN_Key]=@GRN_Key" 
        DeleteCommand="DELETE FROM Tbl_GRNrequest WHERE (GRN_Key =@GRN_Key)" >
       
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="Or_ID" Type="Int32" />
        </SelectParameters>

        <DeleteParameters>
       <asp:Parameter Name="GRN_Key" Type="String" />
        </DeleteParameters>

        <UpdateParameters>
            <asp:Parameter Name="Pro_Name" Type="String" />
            <asp:Parameter Name="Pur_Price" Type="Decimal" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Qty" Type="Decimal" />
         <asp:Parameter Name="GRN_Key" Type="String" />
        </UpdateParameters>


    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
                        SelectCommand="SELECT [Sup_ID], [Sup_Name] FROM [Tbl_Supplier]">
                    </asp:SqlDataSource>
   <dx:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="ASPxGridView2"></dx:ASPxGridViewExporter>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
                    
        
        
        SelectCommand="SELECT DISTINCT [Or_ID] FROM [Tbl_GRNrequest] WHERE ([manger_status] IS NULL)">
                </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        SelectCommand="SELECT Pro_Name FROM Tbl_Product" >

          </asp:SqlDataSource>

</asp:Content>


